#include <algorithm>
#include <cstdio>
#include <stack>

typedef long long ll;
const int N = 300005, M = 500005, mod = 998244353;
int n, m, cnt, id, sum, dfn[N], low[N], cc[N];
int e_cnt, heads[N];
std::stack<int> stk;

struct Edge {
  int v, nxt;
} e[M << 1];

inline void add(int u, int v) {
  e[++e_cnt].v = v, e[e_cnt].nxt = heads[u], heads[u] = e_cnt;
}

void tarjan(int x) {
  dfn[x] = low[x] = ++cnt;
  stk.push(x);
  for (int i = heads[x], v; i; i = e[i].nxt) {
    if (!dfn[v = e[i].v]) {
      tarjan(v);
      low[x] = std::min(low[x], low[v]);
      if (low[v] == dfn[x]) {
        int tmp(0);
        cc[++id] = 1;
        do {
          tmp = stk.top();
          stk.pop();
          ++cc[id];
        } while (tmp != v);
      }
    } else
      low[x] = std::min(low[x], dfn[v]);
  }
}

inline int qpow(ll base, int exp) {
  ll res = 1;
  while (exp) {
    if (exp & 1) res = res * base % mod;
    base = base * base % mod;
    exp >>= 1;
  }
  return res;
}

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("desert.in", "r", stdin);
  freopen("desert.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &m);
  for (int i = 1, u, v; i <= m; ++i) {
    scanf("%d%d", &u, &v);
    add(u, v), add(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    if (!dfn[i]) tarjan(i), stk.pop();
  }
  ll ans = 1;
  for (int i = 1; i <= id; ++i) {
    if (cc[i] == 2) continue;
    sum += cc[i];
    ans *= (qpow(2, cc[i]) - 1 + mod) % mod;
    ans %= mod;
  }
  ans *= qpow(2, m - sum);
  ans %= mod;
  printf("%lld", ans);
  return 0;
}